Integrand size = 13, antiderivative size = 82 \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{4} \sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )-\frac {1}{2} \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )-\frac {1}{4} \sin \left (\frac {1}{4}+x+x^2\right )+\frac {1}{2} x \sin \left (\frac {1}{4}+x+x^2\right ) \]
[Out]
Time = 0.05 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3545, 3543, 3527, 3433, 3526, 3432} \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{4} \sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {2 x+1}{\sqrt {2 \pi }}\right )-\frac {1}{2} \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {2 x+1}{\sqrt {2 \pi }}\right )+\frac {1}{2} x \sin \left (x^2+x+\frac {1}{4}\right )-\frac {1}{4} \sin \left (x^2+x+\frac {1}{4}\right ) \]
[In]
[Out]
Rule 3432
Rule 3433
Rule 3526
Rule 3527
Rule 3543
Rule 3545
Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} x \sin \left (\frac {1}{4}+x+x^2\right )-\frac {1}{2} \int x \cos \left (\frac {1}{4}+x+x^2\right ) \, dx-\frac {1}{2} \int \sin \left (\frac {1}{4}+x+x^2\right ) \, dx \\ & = -\frac {1}{4} \sin \left (\frac {1}{4}+x+x^2\right )+\frac {1}{2} x \sin \left (\frac {1}{4}+x+x^2\right )+\frac {1}{4} \int \cos \left (\frac {1}{4}+x+x^2\right ) \, dx-\frac {1}{2} \int \sin \left (\frac {1}{4} (1+2 x)^2\right ) \, dx \\ & = -\frac {1}{2} \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )-\frac {1}{4} \sin \left (\frac {1}{4}+x+x^2\right )+\frac {1}{2} x \sin \left (\frac {1}{4}+x+x^2\right )+\frac {1}{4} \int \cos \left (\frac {1}{4} (1+2 x)^2\right ) \, dx \\ & = \frac {1}{4} \sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )-\frac {1}{2} \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )-\frac {1}{4} \sin \left (\frac {1}{4}+x+x^2\right )+\frac {1}{2} x \sin \left (\frac {1}{4}+x+x^2\right ) \\ \end{align*}
Time = 0.10 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.82 \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{8} \left (\sqrt {2 \pi } \operatorname {FresnelC}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )-2 \left (\sqrt {2 \pi } \operatorname {FresnelS}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )+(1-2 x) \sin \left (\frac {1}{4}+x+x^2\right )\right )\right ) \]
[In]
[Out]
Time = 1.86 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.72
method | result | size |
default | \(\frac {x \sin \left (\frac {1}{4}+x +x^{2}\right )}{2}-\frac {\sin \left (\frac {1}{4}+x +x^{2}\right )}{4}+\frac {\sqrt {2}\, \sqrt {\pi }\, \operatorname {C}\left (\frac {\sqrt {2}\, \left (x +\frac {1}{2}\right )}{\sqrt {\pi }}\right )}{8}-\frac {\sqrt {2}\, \sqrt {\pi }\, \operatorname {S}\left (\frac {\sqrt {2}\, \left (x +\frac {1}{2}\right )}{\sqrt {\pi }}\right )}{4}\) | \(59\) |
risch | \(-\frac {\sqrt {\pi }\, \left (-1\right )^{\frac {3}{4}} \operatorname {erf}\left (\left (-1\right )^{\frac {1}{4}} x +\frac {\left (-1\right )^{\frac {1}{4}}}{2}\right )}{16}-\frac {\left (-1\right )^{\frac {1}{4}} \sqrt {\pi }\, \operatorname {erf}\left (\left (-1\right )^{\frac {1}{4}} x +\frac {\left (-1\right )^{\frac {1}{4}}}{2}\right )}{8}+\frac {\sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-i}\, x -\frac {i}{2 \sqrt {-i}}\right )}{16 \sqrt {-i}}+\frac {i \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-i}\, x -\frac {i}{2 \sqrt {-i}}\right )}{8 \sqrt {-i}}+2 i \left (-\frac {1}{4} i x +\frac {1}{8} i\right ) \sin \left (\frac {\left (1+2 x \right )^{2}}{4}\right )\) | \(111\) |
parts | \(\frac {\sqrt {2}\, \sqrt {\pi }\, \operatorname {C}\left (\frac {\sqrt {2}\, \left (x +\frac {1}{2}\right )}{\sqrt {\pi }}\right ) x^{2}}{2}-\frac {\sqrt {2}\, \pi ^{\frac {3}{2}} \left (\frac {\operatorname {C}\left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right ) \left (\left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right )^{2} \sqrt {\pi }-\left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right ) \sqrt {2}\right )}{\sqrt {\pi }}-\frac {\frac {\left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right ) \sin \left (\frac {\pi \left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right )^{2}}{2}\right )}{\sqrt {\pi }}-\frac {\operatorname {S}\left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right )}{\sqrt {\pi }}-\frac {\sqrt {2}\, \sin \left (\frac {\pi \left (\frac {\sqrt {2}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}}{2 \sqrt {\pi }}\right )^{2}}{2}\right )}{\pi }}{\sqrt {\pi }}\right )}{4}\) | \(205\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.72 \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{8} \, \sqrt {2} \sqrt {\pi } \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, x + 1\right )}}{2 \, \sqrt {\pi }}\right ) - \frac {1}{4} \, \sqrt {2} \sqrt {\pi } \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, x + 1\right )}}{2 \, \sqrt {\pi }}\right ) + \frac {1}{4} \, {\left (2 \, x - 1\right )} \sin \left (x^{2} + x + \frac {1}{4}\right ) \]
[In]
[Out]
\[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=\int x^{2} \cos {\left (x^{2} + x + \frac {1}{4} \right )}\, dx \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.44 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.95 \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=-\frac {16 \, x {\left (-i \, e^{\left (i \, x^{2} + i \, x + \frac {1}{4} i\right )} + i \, e^{\left (-i \, x^{2} - i \, x - \frac {1}{4} i\right )}\right )} + \sqrt {4 \, x^{2} + 4 \, x + 1} {\left (\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {i \, x^{2} + i \, x + \frac {1}{4} i}\right ) - 1\right )} - \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {-i \, x^{2} - i \, x - \frac {1}{4} i}\right ) - 1\right )} - \left (4 i + 4\right ) \, \sqrt {2} \Gamma \left (\frac {3}{2}, i \, x^{2} + i \, x + \frac {1}{4} i\right ) + \left (4 i - 4\right ) \, \sqrt {2} \Gamma \left (\frac {3}{2}, -i \, x^{2} - i \, x - \frac {1}{4} i\right )\right )} - 8 i \, e^{\left (i \, x^{2} + i \, x + \frac {1}{4} i\right )} + 8 i \, e^{\left (-i \, x^{2} - i \, x - \frac {1}{4} i\right )}}{32 \, {\left (2 \, x + 1\right )}} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.43 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.91 \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=-\left (\frac {3}{32} i - \frac {1}{32}\right ) \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\left (\frac {1}{4} i - \frac {1}{4}\right ) \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) + \left (\frac {3}{32} i + \frac {1}{32}\right ) \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\left (\frac {1}{4} i + \frac {1}{4}\right ) \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) + \frac {1}{8} \, {\left (-2 i \, x + i\right )} e^{\left (i \, x^{2} + i \, x + \frac {1}{4} i\right )} + \frac {1}{8} \, {\left (2 i \, x - i\right )} e^{\left (-i \, x^{2} - i \, x - \frac {1}{4} i\right )} \]
[In]
[Out]
Time = 0.12 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.78 \[ \int x^2 \cos \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {x\,\sin \left (x^2+x+\frac {1}{4}\right )}{2}-\frac {\sin \left (x^2+x+\frac {1}{4}\right )}{4}+\frac {\sqrt {2}\,\sqrt {\pi }\,\mathrm {C}\left (\frac {\sqrt {2}\,\left (2\,x+1\right )}{2\,\sqrt {\pi }}\right )}{8}-\frac {\sqrt {2}\,\sqrt {\pi }\,\mathrm {S}\left (\frac {\sqrt {2}\,\left (2\,x+1\right )}{2\,\sqrt {\pi }}\right )}{4} \]
[In]
[Out]